package com.z.sys.service.impl;

import java.util.List;
import java.util.ArrayList;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.z.common.web.vo.request.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.z.sys.mapper.FestivalMapper;
import com.z.sys.entity.Festival;
import com.z.sys.service.IFestivalService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

import javax.annotation.Resource;
import java.util.Arrays;
/**
 * 节假日管理Service业务层处理
 *
 * @author z
 * @date 2023-07-18
 */
@Service
public class FestivalServiceImpl extends ServiceImpl<FestivalMapper,Festival> implements IFestivalService {


    @Resource
    private FestivalMapper festivalMapper;
    /**
     * 查询节假日管理
     * @param festival 节假日管理
     * @param pageVo
     * @return 节假日管理 分页集合
     * */
    @Override
    public PageInfo<Festival> selectFestivalPage(Festival festival, PageVo pageVo) {
        PageHelper.startPage(pageVo.getPage(), pageVo.getLimit());
        List<Festival> data = selectFestivalList(festival);
        return new PageInfo<>(data);
    }

    @Override
    public List<Festival> selectFestivalList(Festival festival) {
        List<Festival> data = baseMapper.selectFestivalList(festival);
        return data;
    }

    @Override
    public Festival getWorksAndRests(String year) {
        return festivalMapper.getWorksAndRests(year);
    }

}
